/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * PrincipalTemporal.java
 *
 * Created on 05/08/2011, 17:14:35
 */
package tsb.UI.Ventanas;

import tsb.dominio.enumeraciones.AsignacionIP;
import tsb.dominio.dispositivos.hostfinal.PC;

/**
 *
 * @author Fede
 */
public class PrincipalTemporal extends javax.swing.JFrame {
    
    private int numeroPC=0;
    private int numeroServer=0;
    private int numeroImpresora=0;
    
    

    /** Creates new form PrincipalTemporal */
    public PrincipalTemporal() {
        initComponents();
        
    }
    
    private String getNombreMostrarPC()
    {
        this.numeroPC++;
        return "PC-"+this.numeroPC;
    }
    
    private String getNombreMostrarServer()
    {
        this.numeroServer++;
        return "Server-"+this.numeroServer;
    }
    
    private String getNombreMostrarImpresora()
    {
        this.numeroImpresora++;
        return "Impresora-"+this.numeroImpresora;
    }
      
            

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        btnArrastrarPC = new javax.swing.JButton();
        btnEditarPC = new javax.swing.JButton();
        btnSalir = new javax.swing.JButton();
        btnArrastrarServer = new javax.swing.JButton();
        btnEditarServer = new javax.swing.JButton();
        btnArrastrarImpresora = new javax.swing.JButton();
        btnEditarImpresora = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        btnArrastrarPC.setText("Arrastrar PC");
        btnArrastrarPC.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnArrastrarPCActionPerformed(evt);
            }
        });

        btnEditarPC.setText("Editar PC");
        btnEditarPC.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEditarPCActionPerformed(evt);
            }
        });

        btnSalir.setText("Salir");
        btnSalir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSalirActionPerformed(evt);
            }
        });

        btnArrastrarServer.setText("Arrastrar Server");
        btnArrastrarServer.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnArrastrarServerActionPerformed(evt);
            }
        });

        btnEditarServer.setText("Editar Server");
        btnEditarServer.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEditarServerActionPerformed(evt);
            }
        });

        btnArrastrarImpresora.setText("Arrastrar Impresora");
        btnArrastrarImpresora.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnArrastrarImpresoraActionPerformed(evt);
            }
        });

        btnEditarImpresora.setText("Editar Impresora");
        btnEditarImpresora.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEditarImpresoraActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(btnSalir, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(btnArrastrarImpresora, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 211, Short.MAX_VALUE)
                            .addComponent(btnArrastrarServer, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 211, Short.MAX_VALUE)
                            .addComponent(btnArrastrarPC, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 211, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(btnEditarImpresora, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(btnEditarServer, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(btnEditarPC, javax.swing.GroupLayout.DEFAULT_SIZE, 217, Short.MAX_VALUE))
                        .addGap(203, 203, 203))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(btnEditarPC, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btnArrastrarPC, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(btnEditarServer, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btnArrastrarServer, javax.swing.GroupLayout.DEFAULT_SIZE, 95, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(btnEditarImpresora, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btnArrastrarImpresora, javax.swing.GroupLayout.DEFAULT_SIZE, 92, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 188, Short.MAX_VALUE)
                .addComponent(btnSalir)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalirActionPerformed
        System.exit(0);
    }//GEN-LAST:event_btnSalirActionPerformed

    private void btnArrastrarPCActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnArrastrarPCActionPerformed

        tsb.gestores.GestorDePC gestorPC = new tsb.gestores.GestorDePC();
        gestorPC.add(this.getNombreMostrarPC(), 10, 10);
    }//GEN-LAST:event_btnArrastrarPCActionPerformed

    private void btnEditarPCActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditarPCActionPerformed

        VentanaPC vPC= new VentanaPC("PC-1");
        vPC.setVisible(true);
       
    }//GEN-LAST:event_btnEditarPCActionPerformed

    private void btnArrastrarServerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnArrastrarServerActionPerformed
  tsb.gestores.GestorDeServer gestorServer = new tsb.gestores.GestorDeServer();
        gestorServer.add(this.getNombreMostrarServer(), 10, 10);
    }//GEN-LAST:event_btnArrastrarServerActionPerformed

    private void btnEditarServerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditarServerActionPerformed
       VentanaServer vServer= new VentanaServer("Server-1");
        vServer.setVisible(true);
    }//GEN-LAST:event_btnEditarServerActionPerformed

    private void btnArrastrarImpresoraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnArrastrarImpresoraActionPerformed
       tsb.gestores.GestorDeImpresora gestorImpresora = new tsb.gestores.GestorDeImpresora();
        gestorImpresora.add(this.getNombreMostrarImpresora(), 10, 10);        // TODO add your handling code here:
    }//GEN-LAST:event_btnArrastrarImpresoraActionPerformed

    private void btnEditarImpresoraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditarImpresoraActionPerformed
        VentanaImpresora vImpresora= new VentanaImpresora("Impresora-1");
        vImpresora.setVisible(true);        // TODO add your handling code here:
    }//GEN-LAST:event_btnEditarImpresoraActionPerformed

   
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnArrastrarImpresora;
    private javax.swing.JButton btnArrastrarPC;
    private javax.swing.JButton btnArrastrarServer;
    private javax.swing.JButton btnEditarImpresora;
    private javax.swing.JButton btnEditarPC;
    private javax.swing.JButton btnEditarServer;
    private javax.swing.JButton btnSalir;
    // End of variables declaration//GEN-END:variables
}
